package com.rhok.wthru_client.servermsgs;

import org.apache.http.HttpResponse;
import org.apache.http.message.BasicNameValuePair;

import com.google.android.maps.GeoPoint;

import android.content.Context;

public class ServerMessageShareLocation extends ServerMessageWithSelfInfo {

	private GeoPoint m_myLocation;
	private boolean declined = false;
	
	public ServerMessageShareLocation(Context context) {
		super(context);
		
		m_myLocation = null;
	}
	
	public void setMyLocation(GeoPoint myLocation) {
		m_myLocation = myLocation;
	}

	@Override
	protected String getRequestPath() {
		return "share_location";
	}
	
	public boolean isDeclined() {
		return declined;
	}

	public void setDeclined(boolean declined) {
		this.declined = declined;
	}

	@Override
	public String send() {
		m_requestValues.add(new BasicNameValuePair("my_location", m_myLocation.toString()));
		
		HttpResponse response = super.sendPostRequest();
		return getResponseString(response);
	}

}
